<?php
include("d:/collect_new/collect/reset/json_fx.php");
$httpheader=<<<TEXT
POST https://trade.taobao.com/trade/itemlist/asyncSold.htm?event_submit_do_query=1&_input_charset=utf8& HTTP/1.1
Host: trade.taobao.com
Connection: keep-alive
Content-Length: 2480
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"
DNT: 1
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
bx-v: 2.2.3
sec-ch-ua-platform: "Windows"
Origin: https://trade.taobao.com
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://trade.taobao.com/trade/itemlist/list_sold_items.htm?spm=a2oq0.12575281.seller-qn-head.2.231f1debr7vRTv&mytmenu=ymbb
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ja;q=0.6,bg;q=0.5,zh-TW;q=0.4,ru;q=0.3,th;q=0.2

auctionType=0&close=0&pageNum=2&pageSize=15&payDateBegin=0&payDateEnd=0&queryMore=false&rxAuditFlag=0&rxElectronicAllFlag=0&rxElectronicAuditFlag=0&rxHasSendFlag=0&rxOldFlag=0&rxSendFlag=0&rxSuccessflag=0&rxWaitSendflag=0&sellerMemo=0&tradeTag=0&useCheckcode=false&useOrderInfo=false&errorCheckcode=false&action=itemlist%2FSoldQueryAction&queryLabelValues=%5B%7B%22label%22%3A%22%E8%AE%A2%E5%8D%95%E7%BC%96%E5%8F%B7%22%2C%22value%22%3A%22%22%2C%22index%22%3A7%7D%2C%7B%22label%22%3A%22%E4%B9%B0%E5%AE%B6%E6%98%B5%E7%A7%B0%22%2C%22value%22%3A%22%22%2C%22index%22%3A4%7D%2C%7B%22label%22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lX12iof7crOzzFZ55nUuhLfgXLvby4CTQWUwIwbwyvH/cag3/7k/EwTIBRC1t64fLsg41x9jtDyEAJah45Q8aNYZeJy7hA0mjnKHFdwI6j0F6tFDeav5QJm8BxKt0muNkfk15cHUxXicpBGpH4fUx5gGVN541sMuLAUrpO7mUGZJXBz2U6koFQFnwKNGyw8sWxGolTgK/gFn5Ny9LO/zZnACc7+bdwTFDjpWZD8qeS8yBwNmxUErmG7veAjmqcz6n/iZ7fTPywd7UoGojhr8sDBn90nVLyp8iK0njrAAJ5Qd9UxCRsFdb9+8y3ZD7cpjNM0cJjq1TXgCheMEaNLVT+zyQ1kxOorA6cRZfE+jsmLCbAQWiMpBf2DRDpPC3iffANIUM3nUiNEMoP2Y+cO8vctZjQ/Vxr2DqvoAtcWgXekrV2fnjMNAkLUfxfz5Cj6nF+YnIwzQKnUZCWmhGxyp4xEQ2UqB8bJ9Vf/3NxiGQwpI5icDVQ3d0uDnuhaahCOLYFNJrZsYaDWYY/AEudShPWYCyouOc7poDxEHjDjhP4IUUPe/Rxk83Fu/rq4RjkFw0yIC4UHcYzB5tIopvoiEazy7Q18zTi/eQQdyhnoHdlE3fkBIFDsHie82NZb02jsoj7CGlLtllIc5D3XW+lnQq6ZBZBCsmJZQ+eGdEtw+fhMAYbHAIHeq/AwPR/1zh0zXPzGEfxkIcnu&bx-umidtoken=G5125974D76DF42377172DCE29F149104C4542214AA6E4CBED8


TEXT;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://collect1.longsunhd.com/collect/reset/json.php?getPhpCode=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array("httpheader"=>$httpheader));
curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
$result=curl_exec($ch);
$request_header = preg_replace("/^((POST|GET)\s*[^\s]+)\s+http/Uixs","\\1&XDEBUG_SESSION_START=543534 HTTP",curl_getinfo($ch, CURLINFO_HEADER_OUT)).http_build_query(array("httpheader"=>$httpheader))."\r\n\r\n";
$request_header = preg_replace('/Content\-Type\:[^\r\n]+/imx','Content-Type: application/x-www-form-urlencoded',$request_header);
//echo $request_header;exit;
curl_close($ch);
$data=json_decode($result,1);
print_r($data['result'][0]);
jsonCreateTable($data['result'][0],"qc_shopro_mall_product","ymh");
jsonToTable($data['result'],"qc_shopro_mall_product","ymh","select id from ymh.qc_shopro_mall_product where itemId='{\$data['itemId']}'");